<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            background-color: red;
            /* margin: 10px; */
        }
        div:first-child{
            /* margin-bottom: 20px; */
           /* = margin-bottom: 40px; */
           /* margin-bottom: 10px; */
           margin-bottom: -10px;
        }
        div:last-child{
            /* margin-top: 20px; */
            /* margin-top: 20px; */
            margin-top: -20px;


        }
    </style>
</head>
<body>
    <div>div1</div>
    <div>div2</div>
</body>
</html>